package com.group.dao;

import com.group.model.LotteryPrize;
import com.group.model.WinningRecord;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository("LotteryDao")
public interface LotteryDao {

    @Select("select * from lotteryprize")
    List<LotteryPrize> findAll();

    @Select("select * from winningrecord order by id desc limit #{arg0}")
    List<WinningRecord> getHorn(Integer limit);

    @Update("UPDATE actuser SET times = #{arg0}")
    int updateTimes(Integer times);

    @Update("UPDATE actuser SET shareTimes = 0")
    int updateshareTimes();

    @Select("select * from winningrecord where userId = #{arg0} ORDER BY  createDate DESC limit #{arg1}")
    List<WinningRecord> getUserRecord(Long userId, Integer limit);
}
